package cn.gyxy.service.impl;

import cn.gyxy.Aspect.Bsrizhi;
import cn.gyxy.mapper.LoginMapper;
import cn.gyxy.pojo.Guanli;
import cn.gyxy.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class LoginServiceimpl implements LoginService {
    @Autowired
    private LoginMapper login;

    @Override
    @Bsrizhi(operation="日志业务")
    public void loginbs(Guanli guanli) {
        Guanli gl = login.loginbs(guanli);

        if (gl == null)
            throw new IllegalArgumentException("该用户不存在，请返回重试");
        if (gl.getPassword().equals(guanli.getPassword()) == false) //传过来的和查询到的密码不相等
            throw new IllegalArgumentException("密码不正确,请返回重试");

    }

}
